import request from '@/utils/request'

const Api = {};

// 查询维护统计
Api.getFaultStatistics = query => {
  return request({
    url: '/business/maintenance/statistics',
    method: 'get',
    params: query
  })
}

// 查询维护记录
Api.getFaultListss = data => {
  return request({
    url: '/business/maintenance/list',
    method: 'get',
    params: data
  })
}

// 修改维护记录
Api.updateFault = data => {
  return request({
    url: '/business/maintenance',
    method: 'put',
    data
  })
}

// 新增维护记录
Api.addFault = data => {
  return request({
    url: '/business/maintenance',
    method: 'post',
    data
  })
}
// 删除维护记录
Api.deleteFault = id => {
  return request({
    url: `/business/maintenance/${id}`,
    method: 'delete',
  })
}

// 查询文档记录
Api.getFaultFile = data => {
  return request({
    url: '/business/maintenance/document/list',
    method: 'get',
    params: data
  })
}
// 删除文档
Api.deleteFaultFile = id => {
  return request({
    url: `/business/maintenance/document/${id}`,
    method: 'delete',
  })
}
// 查询台站下的所有设备
Api.selectDevice = data => {
  const {regionalNodeId, deviceType} = data;
  return request({
    url: `/business/node/${regionalNodeId}/device/${deviceType}/list`,
    method: 'get'
  })
}

// 获取报警列表
Api.getAlarmList = params => {
  return request({
    url: `/business/alarm/list`,
    method: 'get',
    params
  })
}

// 删除报警
Api.deleteAlarm = alarmId => {
  return request({
    url: `/business/alarm`,
    method: 'put',
    data: {
      status: '0',
      alarmId
    }
  })
}





export default Api;